﻿@using Pyramid.Extentions
@using Pyramid.Models
@using Pyramid.Mvc.Html
@model Article
@{
	var channels = (SelectList) ViewBag.Channels;
}
<div class="pageContent">
	@using (Html.BeginForm("Edit", "Article", FormMethod.Post, new {@class = "pageForm required-validate", onsubmit = "return validateCallback(this, navTabAjaxDone);"}))
	{
		<div class="pageFormContent" layouth="56">
			@Html.HiddenFor(x => x.Id)
			<p class="nowrap">
				@Html.LabelFor(m => m.Title)
				@Html.TextBoxFor(m => m.Title, new {@class = "required longText", minlength = "6", maxlength = "50"})
			</p>
			<p>
				@Html.LabelFor(m => m.ChannelId)
				@Html.DropDownList("ChannelId", channels, new {@class = "required"})
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.Summary)
				@Html.TextAreaFor(m => m.Summary, new {@class = "required longText longParagraph"})
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.Content)
				@Html.TextAreaFor(m => m.Content)
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.Status)
				@Html.DropDownList("Status", Model.StatusEnum.ToSelectList())
			</p>
			<div class="divider"></div>
			<p>
				@Html.LabelFor(m => m.CreateUserId)
				@Html.ReadonlyFieldFor(m => m.CreateUserId)
			</p>
			<p>
				@Html.LabelFor(m => m.CreateTime)
				@Html.ReadonlyDateTimeFor(m => m.CreateTime)
			</p>
			<p>
				@Html.LabelFor(m => m.EditUserId)
				@Html.ReadonlyFieldFor(m => m.EditUserId)
			</p>
			<p>
				@Html.LabelFor(m => m.EditTime)
				@Html.ReadonlyDateTimeFor(m => m.EditTime)
			</p>
		</div>
		<div class="formBar">
			<ul>
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div>
				</li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	}
</div>
<script src="@Url.Content("~/UEditor/ueditor.config.js")"></script>
<script src="@Url.Content("~/UEditor/ueditor.all.js")"></script>
<script>
	UE.getEditor('Content');
</script>